package com.vstudy.zx.dao;

import com.vstudy.zx.entity.StarComments;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface CommentsDao {
    @Insert("insert into tb_star_comments(article_id,sc_role,role_id,sc_level) " +
            "values(#{article.article_id},#{sc_role},#{role_id},#{sc_level})")
    int addStar(StarComments star);

    @Update("update tb_star_comments set sc_level=#{sc_level} where sc_id=#{sc_id}")
    int updateStar(StarComments star);

    @Select("select * from tb_star_comments where article_id=#{article.article_id} " +
            "and sc_role=#{sc_role} and role_id=#{role_id}")
    StarComments select(StarComments star);
}
